package com.wswy.wyjk.ui.login.model;

import com.my.httpapi.api.baseApi.ComObserver;
import com.my.httpapi.api.baseView.BaseModel;
import com.wswy.wyjk.api.Api;
import com.wswy.wyjk.api.entity.DeviceMod;
import com.wswy.wyjk.ui.login.Interface.ILogin;

import java.util.Map;

public class RequestLoginModel extends BaseModel implements ILogin.IModel {

    public void getCaptcha(Map<String, String> map, ComObserver<CaptchaData> comObserver) {
        Api.getApi().getCaptcha(map).compose(comTransformer).subscribe(comObserver);
    }

    public void validCaptchaTc(Map<String, String> map, ComObserver<CaptchaValidData> comObserver) {
        Api.getApi().validCaptchaTc(map).compose(comTransformer).subscribe(comObserver);
    }

    public void code(Map<String, String> map, ComObserver<Boolean> comObserver) {
        Api.getApi().code(map).compose(comTransformer).subscribe(comObserver);
    }

    public void login(Map<String, String> map, ComObserver<LoginResponse> comObserver) {
        Api.getApi().login(map).compose(comTransformer).subscribe(comObserver);
    }

    public void picSend(Map<String, String> map, ComObserver<SendPicResponse> comObserver) {
        Api.getApi().sendPic(map).compose(comTransformer).subscribe(comObserver);
    }

    public void verSend(Map<String, String> map, ComObserver<VerificationPicResponse> comObserver) {
        Api.getApi().verificationPic(map).compose(comTransformer).subscribe(comObserver);
    }

    public void requestDevice(Map<String, String> map, ComObserver<DeviceMod> comObserver) {
        Api.getApi().requestDevice(map).compose(comTransformer).subscribe(comObserver);
    }
}
